<template>
	<view class="houserentals">
		<view class="title">
			<view :class="actives == index ?'active' :'items'" v-for="(item,index) in titlelist" :key="index"
				@click="active(index)">
				{{item}}
			</view>
		</view>
		<view class="content" v-for="(item,index) in 6" :key="index" @click="godetails">
			<view class="left">
				<view class="Image">
					<view class="zhizu">
						房东直租
					</view>
				</view>
			</view>
			<view class="right">
				<view class="right-name">
					整租 三室一厅一厨一卫
				</view>
				<view class="pingfangmi">
					101m²
				</view>
				<view class="price">
					￥4500/月
				</view>
			</view>
		</view>

	</view>
</template>

<script setup>
	import MaskAlertVue from '../../../../components/MaskAlert.vue';

	import {
		ref
	} from 'vue'
	let titlelist = ref(['全部房源', '整租', '合租'])
	let actives = ref(0)

	const active = (index) => {
		actives.value = index
	}
	const godetails = () => {
		uni.navigateTo({
			url: '/pages/server/views/RentalDetails/RentalDetails'
		})
	}
</script>

<style lang="scss">
	.houserentals {
		height: 100%;
		padding: 30rpx;
		background-color: #fdfeff;

		.content {
			padding: 30rpx;
			display: flex;
			margin-top: 30rpx;
			border: 2rpx solid #f2f2f2;
			background-color: white;
			border-radius: 10rpx;
			margin-bottom: 30rpx;

			.left {
				margin-right: 30rpx;

				.zhizu {
					width: 128rpx;
					padding: 5rpx 10rpx;
					color: white;
					font-size: 26rpx;
					background-color: #2ed477;
					border-radius: 12rpx;
				}

				.Image {
					width: 220rpx;
					height: 160rpx;
					background-color: #e6f1ff;
					border-radius: 12rpx;
				}
			}
		}

		.right {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			font-size: 30rpx;

			.pingfangmi {
				font: 26rpx;
				color: #aaa;
			}

			.price {
				color: #f46468;
				font-size: 28rpx;
			}
		}

		.title {
			display: flex;
			border: 2rpx solid #f2f2f2;
			width: 480rpx;
			margin: auto;

			.items {
				width: 160rpx;
				height: 50rpx;
				text-align: center;
				font-size: 28rpx;
				line-height: 50rpx;
			}

			.active {
				width: 160rpx;
				height: 50rpx;
				text-align: center;
				font-size: 28rpx;
				background-color: #006eff;
				color: white;
				line-height: 50rpx;
				border-radius: 8rpx;
			}
		}
	}
</style>